package wekan.client;

import android.app.Activity;
import android.content.Context;

import android.location.Location;

import android.location.LocationListener;

import android.location.LocationManager;

import android.os.Bundle;

import android.util.Log;
import android.widget.Toast;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.io.DataOutputStream;

public class WMainActivity extends Activity
{

    private WModel model;
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Log.d(WModel.TAG, "MAIN UI STARTING ...") ;
        model = (WModel)this.getApplication() ;


        model.startGPS((LocationManager)getSystemService(Context.LOCATION_SERVICE));
        model.startNetwork();


        model.getNetwork().send(model.getCurrentLocation());

        try {
            model.getNetwork().stopNetwork();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
    }

}
